package com.mdd.admin.validate.course;

import com.mdd.admin.validate.BaseParam;
import com.mdd.common.validator.annotation.IDMust;
import com.mdd.common.validator.annotation.IntegerContains;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import lombok.Data;
import javax.validation.constraints.*;

/**
 * 课件资料参数
 * @author panweiliang
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class CourseMaterialParam extends BaseParam {

    @IDMust(message = "id参数必传且需大于0", groups = {update.class, delete.class})
    private Integer id;

    @NotNull(message = "courseId参数缺失", groups = {create.class, update.class})
    private Integer courseId;

    @NotNull(message = "文件名称缺失", groups = {create.class, update.class})
    @Length(max = 255, message = "文件名称不能超出255个字符", groups = {create.class, update.class})
    private String fileName; //课程资料名称

    @NotNull(message = "content参数缺失", groups = {create.class, update.class})
    @Length(max = 255, message = "内容不能超出255个字符", groups = {create.class, update.class})
    private String content;

    @NotNull(message = "link参数缺失", groups = {create.class, update.class})
//    @NotEmpty(message = "courseId参数不能为空字符", groups = {create.class, update.class})
    @Length(max = 255, message = "网盘链接不能超出255个字符", groups = {create.class, update.class})
    private String link;

    @NotNull(message = "code参数缺失", groups = {create.class, update.class})
    @Length(max = 16, message = "网盘密码不能超出16个字符", groups = {create.class, update.class})
    private String code;

    @NotNull(message = "isLink参数缺失", groups = {create.class, update.class})
    @IntegerContains(values = {0, 1}, message = "isLink参数值不在符合范围", groups = {create.class, update.class})
    private Integer isLink;

}
